/*
 */

#ifndef DHT11_H
#define DHT11_H
#ifdef	__cplusplus
extern	"C" {
#endif

#include <stdint.h>
#define u16 uint16_t 
#define u8  uint8_t 
enum {RESET = 0, SET = !RESET};

#define DHT11_DQ_PIN	CONFIG_DHT11_DQ_PIN


#define DHT11_OUT_H     gpio_set_level(DHT11_DQ_PIN, 1)
#define DHT11_OUT_L    	gpio_set_level(DHT11_DQ_PIN, 0)

//WifiIotGpioValue getVal();

#define DHT11_IN    dht11_gpio_read()

void	 delay_us(uint32_t cnt);                     
#define  delay_ms(nms)                      delay_us((nms)*1000)
#define  delay_s(ns)                        delay_ms((ns)*1000)

uint8_t dht11_gpio_read(void);
void dht11_gpio_init(void);
void dht11_gpio_input(void);
void dht11_gpio_output(void);
u16 dht11_scan(void);
u8 dht11_read_byte(void);
u16 dht11_read_data(uint8_t buffer[4]);

uint32_t DHT11_Config(void);


uint32_t DHT11_GetResult(float* temp, float* humi);

#ifdef	__cplusplus
}
#endif


#endif  // DHT11_H
